<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2  (Unix)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGED" CONTENT="20110101;14365400">
	<STYLE TYPE="text/css">
	<!--
		@page { margin: 0.79in }
		P { margin-bottom: 0.08in }
		PRE { font-family: "Times New Roman" }
	-->
	</STYLE>
</HEAD>
<BODY LANG="el-GR" DIR="LTR">
<PRE LANG="en-US"><FONT SIZE=5><B>The (ordinary)  eigenvalue problem</B></FONT>

<FONT SIZE=5><SPAN LANG="en-US"><B>Real symmetric tridiagonal matrices</B></SPAN></FONT>

<FONT SIZE=5><SPAN LANG="en-US"><B>valsymtri, vecsymtri</B></SPAN></FONT>


<FONT SIZE=4><SPAN LANG="en-US"><SPAN STYLE="font-style: normal">Calculates all or some consecutive eigenvalues in descending order of magnitude, of a symmetric </SPAN><I>nXn</I><SPAN STYLE="font-style: normal"> tridiagonal matrix T,</SPAN></SPAN></FONT>
<FONT SIZE=4><SPAN LANG="en-US"><SPAN STYLE="font-style: normal">for</SPAN> details see book of Hang T. Lau, “A Java Numerical Library for Scientists and engineers|”, Chapman &amp; Hall, 2004</SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US"><B>Example: Can be run with F5 within the ScalaLab Editor (Ctrl-E to open the editor)</B></SPAN></FONT>

<SPAN LANG="en-US">import java.text.DecimalFormat;</SPAN>
<SPAN LANG="en-US">import numal.*;</SPAN>

<SPAN LANG="en-US">public class Test_valsymtri extends Object {</SPAN>
<SPAN LANG="en-US">	</SPAN>
<SPAN LANG="en-US">	public static void main(String args[]) {</SPAN>

    <SPAN LANG="en-US">double b[] = new double[5];</SPAN>
    <SPAN LANG="en-US">double d[] = new double[5];</SPAN>
    <SPAN LANG="en-US">double bb[] = new double[4];</SPAN>
    <SPAN LANG="en-US">double val[] = new double[3];</SPAN>
    <SPAN LANG="en-US">double em[] = new double[10];</SPAN>
    <SPAN LANG="en-US">double vec[][] = new double[5][3];</SPAN>

    <SPAN LANG="en-US">em[0]=1.0e-6; em[1]=4.0;  em[2]=1.0e-5;</SPAN>
    <SPAN LANG="en-US">em[4]=1.0e-3;  em[6]=1.0e-6; em[8]=5.0;</SPAN>
    <SPAN LANG="en-US">d[1]=d[2]=d[3]=d[4]=2.0;</SPAN>
    <SPAN LANG="en-US">b[4]=0.0; b[1]=b[2]=b[3] = -1.0;</SPAN>
    <SPAN LANG="en-US">bb[1]=bb[2]=bb[3]=1.0;</SPAN>
    <SPAN LANG="en-US">Linear_algebra.valsymtri(d,bb,4,1,2,val,em);</SPAN>
    <SPAN LANG="en-US">Linear_algebra.vecsymtri(d,b,4,1,2,val,vec,em);</SPAN>
    <SPAN LANG="en-US">DecimalFormat fiveDigit = new DecimalFormat(&quot;0.00000E0&quot;);</SPAN>
    <SPAN LANG="en-US">System.out.println(&quot;The eigenvalues:\n   &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(val[1]) + &quot;    &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(val[2]) +</SPAN>
      <SPAN LANG="en-US">&quot;\n\nThe eigenvectors:\n  &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(vec[1][1]) + &quot;   &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(vec[1][2]) + &quot;\n   &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(vec[2][1]) + &quot;  &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(vec[2][2]) + &quot;\n  &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(vec[3][1]) + &quot;  &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(vec[3][2]) + &quot;\n   &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(vec[4][1]) + &quot;   &quot; +</SPAN>
      <SPAN LANG="en-US">fiveDigit.format(vec[4][2]) +     </SPAN>
      <SPAN LANG="en-US">&quot;\n\nEM[7] =  &quot; + fiveDigit.format(em[7]) +</SPAN>
      <SPAN LANG="en-US">&quot;\nEM[3] =  &quot; + (int)em[3] +</SPAN>
      <SPAN LANG="en-US">&quot;\nEM[5] =  &quot; + (int)em[5] +</SPAN>
      <SPAN LANG="en-US">&quot;\nEM[9] =  &quot; + (int)em[9]);</SPAN>
<SPAN LANG="en-US">	}</SPAN>
<SPAN LANG="en-US">}</SPAN>
</PRE>
</BODY>
</HTML>